<template>
	<div>
		<div class="a" @click="a">
			<div class="b" @click.stop="b" :style="{backgroundColor:bg}"></div>
		</div>
	</div>
</template>

<script>
	export default {
		data(){
			return{
				bg:'rgb(255,0,0)'
			}
		},
		methods: {
			a(){
				alert("handler1")
			},
			b(){
				this.bg = "rgb("+this.rand()+","+this.rand()+","+this.rand()+")" 
			},
			rand(){
				return Math.random()*255
			}
		}
	}
</script>

<style>
	.a{
		width: 200px;
		height: 200px;
		border: 1px solid #000;
	}
	.b{
		width: 100px;
		height: 100px;
	}
</style>
